package com.example.demo.typeEnums;

/**
 * @author 又菜又爱浪
 * @date 2021-12-20
 * 执行类型枚举
 */
public enum ExecuteType {
    /**
     * 删除
     */
    DELETE("DELETE",1),

    /**
     * 归档
     */
    ARCHIVE("ARCHIVE",2),
    ;

    private String name;
    private Integer value;

    ExecuteType(String name,Integer value) {
        this.name = name;
        this.value = value;
    }

    public String getName(){
        return name;
    }
    public Integer getValue() {
        return value;
    }

    public static ExecuteType getExecuteType(String name, Integer value){
        for(ExecuteType executeType : ExecuteType.values()){
            if(executeType.name.equals(name) || executeType.value.equals(value)){
                return executeType;
            }
        }
        return DELETE;
    }
}
